package org.eCon.maven.generatorFactory;

import org.eCon.maven.iPlugin.IHost;
import org.eCon.maven.plugin.windows.WindowsGWTRunPlugin;
import org.eCon.maven.plugin.unixBased.mac.MacGWTRunPlugin;
import org.eCon.maven.plugin.unixBased.linux.LinuxGWTRunPlugin;

/**
 *
 * User: erkink
 * Date: 14-Aug-2008
 * Time: 20:29:34
 *
 */
public class GWTRunPluginGeneratorImpl implements IGWTRunPluginGenerator{
    public IHost createPlugin(String os){
        if (os == null)
            throw new IllegalArgumentException("OS param can not be null.");

        IHost builder;
        if (os.equalsIgnoreCase("win") || os.equalsIgnoreCase("win32") || os.equalsIgnoreCase("windows")) {
            builder = new WindowsGWTRunPlugin();
        } else if (os.equalsIgnoreCase("mac")) {
            builder = new MacGWTRunPlugin();
        } else {
            builder = new LinuxGWTRunPlugin();
        }

        return builder;
    }
}
